home *** CD-ROM | disk | FTP | other *** search
- property pMySprite
- global gFormatList
-
- on beginSprite me
- pMySprite = sprite(me.spriteNum)
- end
-
- on mouseEnter me
- case the currentSpriteNum of
- "80":
- put "Source path. Click to browse for a new folder or file to process. D + click to clear." into field "status"
- "82":
- put "Destination folder path. Click to browse for new folder. D + click to clear." into field "status"
- end case
- end
-
- on mouseLeave me
- put EMPTY into field "status"
- end
-
- on mouseDown me
- if keyPressed("d") then
- pMySprite.member.text = EMPTY
- pass()
- else
- if pMySprite = sprite(82) then
- if sprite(86).pState then
- folderText()
- else
- myFolder = baGetFolder(pMySprite.member.text, "Select a folder for the resized images:", 1, "Browse for Folder", -1, 0)
- if myFolder = EMPTY then
- pass()
- else
- pMySprite.member.text = myFolder
- end if
- end if
- else
- thePath = pMySprite.member.text
- if the last char in thePath = "\" then
- nothing()
- else
- the itemDelimiter = "\"
- delete char -30002 of thePath
- put "\" after myFolder
- the itemDelimiter = ","
- end if
- if sprite(84).pState then
- sourceFile = baGetFilename("open", thePath, EMPTY, "Image files (.jpg, .gif, .bmp, .png, .tif, .tga)|*.jpg;*.gif;*.bmp;*.png;*.tif;*.tga", 2 + 4 + 524288, "Select Image to Process", 0, -1, 0)
- if sourceFile = EMPTY then
- pass()
- else
- sFileCount = the number of chars in sourceFile
- sFileEx = char sFileCount - 2 to sFileCount of sourceFile
- if getOne(gFormatList, symbol(sFileEx)) = 0 then
- if sFileEx = "jpg" then
- sendSprite(24, #finishSetting2)
- else
- if sFileEx = "gif" then
- sendSprite(26, #finishSetting2)
- else
- if sFileEx = "bmp" then
- sendSprite(28, #finishSetting2)
- else
- if sFileEx = "png" then
- sendSprite(30, #finishSetting2)
- else
- if sFileEx = "tif" then
- sendSprite(32, #finishSetting2)
- else
- if sFileEx = "tga" then
- sendSprite(34, #finishSetting2)
- end if
- end if
- end if
- end if
- end if
- end if
- end if
- pMySprite.member.text = sourceFile
- end if
- else
- myFolder = baGetFolder(thePath, "Select the folder containing the original images:", 1, "Browse for Folder", -1, 0)
- if myFolder = EMPTY then
- pass()
- else
- pMySprite.member.text = myFolder
- end if
- end if
- end if
- end if
- end
-